/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.OneToMany;

/**
 *
 * @author zhozho
 */
@Entity
public class PlannedMonthlyDemand extends PlannedDemand implements Serializable {
    private String monthName;
    //private MonthlySaleForecast monthlyForecast;
    private String monthlyForecast;
    
    private Long productionPlan;
    private Long inventory;
    private Long numberOfWorkingDays;
    private Long nutriCapacity;
    private Long premiumCapacity;
    private Long numberofWeeks;
    private Long utilization;
    
    @OneToMany
    List<PlannedWeeklyDemand> listOfPlannedWeeklyDemand = new ArrayList<PlannedWeeklyDemand>();

    public PlannedMonthlyDemand() {
    }

    //TEMPORARY
    public PlannedMonthlyDemand(String monthName, String monthlyForecast, Long productionPlan, Long inventory) {
        this.monthName = monthName;
        this.monthlyForecast = monthlyForecast;
        this.productionPlan = productionPlan;
        this.inventory = inventory;
    }

    
    
    public List<PlannedWeeklyDemand> getListOfPlannedWeeklyDemand() {
        return listOfPlannedWeeklyDemand;
    }

    public void setListOfPlannedWeeklyDemand(List<PlannedWeeklyDemand> listOfPlannedWeeklyDemand) {
        this.listOfPlannedWeeklyDemand = listOfPlannedWeeklyDemand;
    }

    public String getMonthName() {
        return monthName;
    }

    public void setMonthName(String monthName) {
        this.monthName = monthName;
    }

    public String getMonthlyForecast() {
        return monthlyForecast;
    }

    public void setMonthlyForecast(String monthlyForecast) {
        this.monthlyForecast = monthlyForecast;
    }


    public Long getNumberOfWorkingDays() {
        return numberOfWorkingDays;
    }

    public void setNumberOfWorkingDays(Long numberOfWorkingDays) {
        this.numberOfWorkingDays = numberOfWorkingDays;
    }

    public Long getNumberofWeeks() {
        return numberofWeeks;
    }

    public void setNumberofWeeks(Long numberofWeeks) {
        this.numberofWeeks = numberofWeeks;
    }

    public Long getProductionPlan() {
        if (productionPlan == null) return new Long(0);
        return productionPlan;
    }

    public void setProductionPlan(Long productionPlan) {
        this.productionPlan = productionPlan;
    }

    public Long getUtilization() {
        if (utilization == null) return new Long(-1);
        return utilization;
    }

    public void setUtilization(Long utilization) {
        if (utilization == null) this.utilization = new Long(0);
        this.utilization = utilization;
    }

    public Long getInventory() {
        if (inventory == null) return new Long(0);
        return inventory;
    }

    public void setInventory(Long inventory) {
        this.inventory = inventory;
    }

    public Long getNutriCapacity() {
        return nutriCapacity;
    }

    public void setNutriCapacity(Long nutriCapacity, Long noWorkingDays) {
        this.nutriCapacity = nutriCapacity * noWorkingDays * 8;
    }

    public Long getPremiumCapacity() {
        return premiumCapacity;
    }

    public void setPremiumCapacity(Long premiumCapacity, Long noWorkingDays) {
        this.premiumCapacity = premiumCapacity * noWorkingDays * 8;
    }
    
}
